package mz.matafe.bolao

import org.codehaus.groovy.grails.plugins.springsecurity.Secured

/**
 * Logout Controller.
 *
 * <p>Handle the system logout
 *
 * @since 0.0.1
 * @author <a href="mailto:matafe@gmail.com">Maurício T. Ferraz</a>
 */
@Secured(['IS_AUTHENTICATED_ANONYMOUSLY'])
class LogoutController {

    /** Redirects to the Spring security logout uri. */
    def index = {
        log.info "User agent: " + request.getHeader("User-Agent")
        session.invalidate()
        redirect(uri: '/j_spring_security_logout')
    }
}
